"use strict"

var Router = require('koa-router');
var config = require('../../config/config.js');
var debug = require('debug')('router_vendor');
var dao = require('../../dao/vendor.js');

debug('router:' + config.http.baseUrl + '/v1/vendor');
var router = new Router({
	prefix: config.http.baseUrl + '/v1/vendor'
});

/*
{ "name":"vendor_add"}
 */
router.post('/', function*() {
	// debug('add vendor');
	// check input TODO
	var inParams = this.request.inParams;
	var result = yield dao.create(inParams);
	this.body = result;
});

module.exports = router.routes();